Skip to content

fsm: generate and verify static address diagrams#1179

Merged
hieblmi merged 5 commits into
lightninglabs:masterfrom
GustavoStingelin:feat/static-address-fsm-diagrams
Jul 21, 2026
Merged

fsm: generate and verify static address diagrams#1179
hieblmi merged 5 commits into
lightninglabs:masterfrom
GustavoStingelin:feat/static-address-fsm-diagrams

Conversation

@GustavoStingelin

Copy link
Copy Markdown
Contributor

Summary

  • make FSM diagram generation deterministic by sorting states and transitions
  • generate diagrams for the static address deposit and loop-in state machines
  • rename the reservation diagram to use fsm.md consistently
  • add make fsm-check and run it in CI to detect stale generated diagrams

Test

  • make fsm-check

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the reliability and coverage of the project's state machine documentation. By enforcing deterministic sorting during diagram generation and adding a verification step to the CI pipeline, the changes ensure that documentation remains synchronized with the implementation. Furthermore, the scope of the generated diagrams has been expanded to include critical static address components, improving overall project transparency.

Highlights

  • Deterministic Generation: Implemented sorting for states and transitions in the FSM parser to ensure consistent and reproducible diagram generation.
  • Expanded Documentation: Added support for generating FSM diagrams for static address deposit and loop-in state machines.
  • CI Verification: Introduced a new make fsm-check target to detect and prevent stale generated diagrams in the repository.
  • Consistency Improvements: Renamed the reservation FSM diagram file to fsm.md to maintain a consistent naming convention across the project.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/main.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces automated checks and generation for FSM (Finite State Machine) Mermaid diagrams, including new diagrams for static address deposits and loop-ins. It refactors the state parser to sort transition keys deterministically and support the new FSM selectors. Feedback on the changes includes defining a reusable variable in the Makefile to avoid duplicating the list of FSM files, renaming a local variable in the state parser to prevent shadowing an imported package, and building the parser binary once in the generation script instead of executing go run multiple times to improve performance.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread Makefile
Comment thread fsm/stateparser/stateparser.go Outdated
Comment thread scripts/fsm-generate.sh
@GustavoStingelin
GustavoStingelin force-pushed the feat/static-address-fsm-diagrams branch from d17c2ba to 2e80b92 Compare July 20, 2026 15:20
Comment thread staticaddr/loopin/fsm.md
Comment on lines +1 to +2
```mermaid
stateDiagram-v2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GitHub rendering looks a bit strange, but it renders well in my local GoLand

Image

@GustavoStingelin

Copy link
Copy Markdown
Contributor Author

I was also thinking of adding ELK, but it looks like it has licensing problems with GitHub support

@hieblmi
hieblmi self-requested a review July 20, 2026 19:52

@hieblmi hieblmi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM!

@hieblmi
hieblmi merged commit 4bb7d5e into lightninglabs:master Jul 21, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants